/**
 * 
 */
package net.cloudcodex.client.campaign.view;

import java.util.Date;

import net.cloudcodex.client.campaign.view.CampaignsView.Message;
import net.cloudcodex.client.campaign.view.panel.CampaignPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.inject.Inject;

/**
 * @author dweltz
 * 
 */
public class CampaignViewImpl extends FlowPanel implements CampaignView {
	
	private final CampaignPanel campaignPanel ;
	private Message message;


	@Inject
	public CampaignViewImpl(Message message) {
		this.message = message ;
		this.campaignPanel = new CampaignPanel(message);
		this.add(campaignPanel);

	}
	
	@Override
	public void addNotification(String notification,Date notificationDate){
		this.campaignPanel.addNotification(notification, notificationDate);
	}
	
	@Override
	public void clearCampaignView(){
		
	}
	
	@Override
	public void refreshNotification(){
		campaignPanel.refreshNotification();
	}
	@Override
	public void addCampaignName(String name){
		campaignPanel.addCampaignName(name);
	}
	
	public void refreshContent(IsWidget isWidget){
		campaignPanel.refreshContent(isWidget);
	}
	
	@Override
	public HasClickHandlers getNotificationListBox(){
		return campaignPanel.getNotificationListBox();
	}
	
	@Override
	public HasClickHandlers getToggleButtonGroup(){
		return campaignPanel.getToggleButtonGroup();
	}
	
	@Override
	public void setSelectedContent(String selectedContent){
		campaignPanel.setSelectedButton(selectedContent);
	}
}
